﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using TaobaoERP.Core.Repository;
using TaobaoERP.Entity;

namespace TaobaoERP.BusinessServices
{
    public class ItemService : RepositoryBase
    {
        /// <summary>
        /// 获取商品列表
        /// </summary>
        /// <param name="Nick"></param>
        /// <param name="PageSize"></param>
        /// <param name="PageIndex"></param>
        /// <returns></returns>
        public static List<Item> ListItemByNick(string Nick,int PageSize,int PageIndex)
        {
            RepositoryContext db = new RepositoryContext();
            var query = from f in db.GetTable<Item>()
                        where f.Nick == Nick
                        select f;
            query = query.Skip(PageSize * PageIndex).Take(PageSize);
            return db.ExecuteQuery<Item>(query);
        }
    }
}
